package servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wto.CollegeBean;
import com.wto.ParseTeacherHtml;

@WebServlet("/CodeServlet")
public class CodeServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
 

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		response.setContentType("application/json;charset=utf-8");
		
		CollegeBean collegeBean=new CollegeBean("0001","西安交通大学","http://jw.zzti.edu.cn");
		ParseTeacherHtml parseHtml=new ParseTeacherHtml(collegeBean);
		parseHtml.getImage();
		System.out.println("get验证码");
		response.sendRedirect("index.jsp");
	}
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
		doGet(request, response);
		response.setContentType("text/html;charset=utf-8");
	}

}
